<?php

namespace api\models;

use Yii;

/**
 * This is the model class for table "{{%special}}".
 *
 * @property int $special_id
 * @property int $special_category_id
 * @property string $title
 * @property string $keyword
 * @property int $status 状态分类:1.发布，0.冻结
 * @property string $date_add
 * @property string $desc 描述
 */
class Special extends \yii\db\ActiveRecord
{
    static public function getOneSpecial($specialId){
        if(empty($specialId)){return false;}
        $data = self::find()->select('s.special_id, s.title, s.keyword,s.desc ,d.description')->from('{{%special}} AS s')->join('LEFT JOIN', '{{%special_description}} AS d', 'd.special_id = s.special_id')->where(['d.special_id' => $specialId, 'status' => 1])->asArray()->one();
        if(empty($data)){return false;}
        return $data;
    }
}
